package com.qf.dao.impl;

import com.qf.dao.TagtypeDao;

import com.qf.pojo.Tagtype;
import com.qf.utils.DataSourceUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

public class TagtypeDaoImpl implements TagtypeDao {
    QueryRunner qr=new QueryRunner(DataSourceUtil.getDataSource());
    @Override
    public Tagtype findTypeById(int tagtypeid) {
            String sql="select * from tagtype where tagtype_id=?";
            try {
                return qr.query(sql,new BeanHandler<>(Tagtype.class),tagtypeid);
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return null;

    }
}
